<template>
  <div class="clock_sub">
    {{setPlay}}
    <div class="b_1 b_b" :class="playActive?'active':''"></div>
    <div class="b_2 b_b" :class="playActive?'active':''"></div>
  </div>
</template>

<script>
  export default {
    name: "clock_sub",
    props: {
      active: {
        type: Boolean,
        default: true
      }
    },
    computed: {
      setPlay() {
        let playTimer = setInterval(() => {});
        if(this.active) {
          playTimer = setInterval(() => {
            this.playActive = !this.playActive;
            return this.playActive
          },500);
        }else{
          this.playActive = false;
          clearInterval(playTimer);
          return this.playActive
        }
      }
    },
    data() {
      return {
        playTimer: null,
        playActive: false
      }
    },
    created() {

    },
    methods: {}
  }
</script>

<style scoped lang="scss">
  .clock_sub {
    width: 100%;
    height: 100%;
    position: relative;
    .b_b{
      width: 4px;
      height: 4px;
      background: #333;
      border-radius: 4px;
      position: absolute;
      left: 2.5px;
    }
    .b_b.active{
      background: #ddd;
    }
    .b_1{
      top: 7px;
    }
    .b_2{
      top: 16px;
    }
  }
</style>
